﻿@section header{

}
<div class="alert alert-info" role="alert">
    <p>本功能应用场景为发布后通过调用<b>健康检查</b>进行系统自我检测</p>
    <div>
        每项检查结果为：
        <span class="label label-success">健康</span>
        <span class="label label-warning">亚健康</span>
        <span class="label label-danger">不健康</span>
        <span class="label label-default">未知</span>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
    <div id="gridPager"></div>
</div>
@section scripts{
    <script>
        var baseUrl = "/Sys/Healths/";
        $(function () {
            gridList();
        })
        function gridList() {
            var $gridList = $("#gridList");
            $gridList.dataGrid({
                url: baseUrl + "GetGridJson",
                height: $(window).height() - 96,
                mtype: "POST",
                colModel: [
                    { label: '分类', name: 'Name', width: 200, align: 'left' },
                    {
                        label: "检查结果", name: "CheckStatus", width: 100, align: "center",
                        formatter: function (cellvalue) {
                            if (cellvalue = 1) {
                                return '<span class="label label-success">健康</span>';
                            } else if (cellvalue = 2) {
                                return '<span class="label label-danger">不健康</span>';
                            } else if (cellvalue = 3) {
                                return '<span class="label label-warning">亚健康</span>';
                            } else if (cellvalue = 4) {
                                return '<span class="label label-default">未知</span>';
                            } else {
                                return '<span class="label label-default">未知</span>';
                            }
                        }
                    },
                    { label: '耗时', name: 'Duration', width: 200, align: 'left' },
                    { label: '内容', name: 'Description', width: 300, align: 'left' }
                ]
            });
        }

    </script>
}